package com.xpp.yanpicturebackend.manager.websocket.model;

import lombok.Getter;

/**
 * 图片编辑消息类型枚举
 */
@Getter
public enum PictureEditMessageTypeEnum {
    INFO("发送通知", "INFO"),
    ERROR("发送错误", "ERROR"),
    ENTER_EDIT("进入编辑", "ENTER_EDIT"),
    EXIT_EDIT("退出编辑", "EXIT_EDIT"),
    EDIT_ACTION("图片编辑动作", "EDIT_ACTION");

    private final String text;
    private final String value;

    PictureEditMessageTypeEnum(String text, String value) {
        this.text = text;
        this.value = value;
    }

    public static PictureEditMessageTypeEnum getEnumByValue(String value) {
        for (PictureEditMessageTypeEnum valueEnum : PictureEditMessageTypeEnum.values()) {
            if (valueEnum.value.equals(value)) {
                return valueEnum;
            }
        }
        return null;
    }
}
